@ GNU AS assembler header file for DHCPClient
@ Written by DefMod (Dec  9 2012) on Sun Dec  9 15:47:15 2012
@ John Tytgat, John.Tytgat@aaug.net, 27 Aug 2009

@ OSLib---efficient, type-safe, transparent, extensible,
@ register-safe API coverage of RISC OS
@ 
@ Copyright (c) 1994-2012 Jonathan Coxhead and OSLib maintainers
@ 
@ Licence:
@ 
@    OSLib is free software; you can redistribute it and/or modify
@ it under the terms of the GNU General Public License as published by
@ the Free Software Foundation; either version 1, or (at your option)
@ any later version - and this with the following clarification and
@ special exception:
@ 
@    Linking this library statically or dynamically with other modules
@ is making a combined work based on this library. Thus, the terms
@ and conditions of the GNU General Public License cover the whole
@ combination.
@ 
@    As a special exception, the copyright holders of this library
@ give you permission to link this library with independent modules
@ to produce an executable, regardless of the license terms of these
@ independent modules, and to copy and distribute the resulting
@ executable under terms of your choice, provided that you also meet,
@ for each linked independent module, the terms and conditions of the
@ license of that module. An independent module is a module which is
@ not derived from or based on this library. If you modify this
@ library, you may extend this exception to your version of the library,
@ but you are not obliged to do so. If you do not wish to do so, delete
@ this exception statement from your version.
@ 
@    OSLib is distributed in the hope that it will be useful,
@ but WITHOUT ANY WARRANTY; without even the implied warranty of
@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
@ GNU General Public License for more details.
@ 
@    You should have received a copy of the GNU General Public License
@ along with this programme; if not, write to the Free Software
@ Foundation, Inc, 675 Mass Ave, Cambridge, MA 02139, USA.

#ifndef DHCPClient_Hdr
#  define DHCPClient_Hdr

#  ifndef Get_Types
#    define Get_Types
#    include "oslib/Types.Hdr"
#  endif

#  ifndef Get_OS
#    define Get_OS
#    include "oslib/OS.Hdr"
#  endif

@Symbols for constants
#  define DHCPClientControlReason_Add 0x0
#  define DHCPClientControlReason_Remove 0x1
#  define DHCPClientControlReason_Renew 0x2
#  define DHCPClientStateType_EndOfList 0xffffffff
#  define DHCPClientStateType_State 0x0
#  define DHCPClientStateType_BoundAddress 0x1
#  define DHCPClientStateType_ServerAddress 0x2
#  define DHCPClientStateType_GatewayAddress 0x3
#  define DHCPClientStateType_LeasePeriod 0x4
#  define DHCPClientStateType_T1Period 0x5
#  define DHCPClientStateType_T2Period 0x6
#  define DHCPClientStateType_DHCPStart 0x7
#  define DHCPClientStateType_LeaseStart 0x8
#  define DHCPClientStateType_LeaseEnd 0x9
#  define DHCPClientStateType_T1End 0xa
#  define DHCPClientStateType_T2End 0xb
#  define DHCPClientStateState_Sleeping 0x0
#  define DHCPClientStateState_InitReboot 0x0
#  define DHCPClientStateState_Init 0x0
#  define DHCPClientStateState_Rebooting 0x0
#  define DHCPClientStateState_Selecting 0x0
#  define DHCPClientStateState_Requesting 0x0
#  define DHCPClientStateState_Bound 0x0
#  define DHCPClientStateState_Renewing 0x0
#  define DHCPClientStateState_Rebinding 0x8

@Symbols for structure offsets and sizes
        .struct 0
        .skip   Int
DHCPClientControl_Reason       : 

        .struct 0
        .skip   Int
DHCPClientState_Types          : 

        .struct 0
        .skip   Int
DHCPClientState_State          : 


@Symbols for SWI's and SWI reason codes
.set XDHCPClient_Control,0x75e00
.set DHCPClient_Control,0x55e00
   @Entry
   @  R0 = reason (DHCPClientControl_Reason)
   @  R1 -> interface_name (Char)

.set XDHCPClient_State,0x75e01
.set DHCPClient_State,0x55e01
   @Entry
   @  R0 -> interface_name (Char)
   @  R1 -> type_list (DHCPClientState_Types)
   @  R2 -> buf (data)
   @  R3 = buf_size (Int)
   @Exit
   @  R1 -> last_type (DHCPClientState_Types)
   @  R2 -> buf_end (data)
   @  R3 = space_left (Int)

.set XDHCPClient_Enumerate,0x75e02
.set DHCPClient_Enumerate,0x55e02
   @Entry
   @  R0 -> interface_name (Char)
   @  R1 = buf (pointer to Char)
   @  R2 = buf_size (Int)
   @Exit
   @  R0 = num_state_transitions (Int)
   @  R1 = buf_end (pointer to Char)
   @  R2 = space_left (Int)

#  define Service_InternetStatus4 0x4
   @Entry
   @  R0 = &4
   @  R1 = &B0
   @  R2 -> interface_name (Char)
   @  R3 -> dib (data)
   @  R4 -> dhcp_reply (data)
   @  R5 = dhcp_reply_size (Int)
   @Exit
   @  R1 = unclaimed (Bool)

#  define Service_InternetStatus5 0x5
   @Entry
   @  R0 = &5
   @  R1 = &B0
   @  R2 -> interface_name (Char)
   @  R3 -> dib (data)
   @  R4 -> dhcpoffer_buf (data)
   @  R5 = dhcpoffer_buf_size (Int)
   @Exit
   @  R1 = unclaimed (Bool)

#  define Service_InternetStatus30 0x30
   @Entry
   @  R0 = &30
   @  R1 = &B0
   @  R2 -> interface_name (Char)
   @  R3 = ip_address (Int)

#  define Service_InternetService31 0x31
   @Entry
   @  R0 = &31
   @  R1 = &B0
   @  R2 -> interface_name (Char)
   @  R3 = ip_address (Int)

#endif
